// 统一管理用户相关的接口
import request from '@/utils/request';
import type {
  LoginForm,
  LoginResponseData,
  UserResponseData,
} from '@/types/api/user';

enum API {
  // 获取用户信息
  USERINFO_URL = '/user/info',
  LOGIN_URL = '/user/login',
}

// 登录接口
export const reqLogin = (data: LoginForm) =>
  request.post<any, LoginResponseData>(API.LOGIN_URL, data);
// 获取用户信息接口
export const reqUserInfo = () =>
  request.get<UserResponseData>(API.USERINFO_URL);
